package com.aaa.system.service.impl;

import com.aaa.entity.Dept;
import com.aaa.entity.Menu;
import com.aaa.entity.SysDictType;
import com.aaa.entity.User;
import com.aaa.security.util.WebUtils;
import com.aaa.system.dao.PersonalCenterDao;
import com.aaa.system.service.PersonalCenterService;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author 崔灿
 * @Date 2023/02/27 19:53
 * @ClassName PeisonalCenterImpl
 * @Description
 * @Version 1.0
 */

@Service
public class PersonalCenterServiceImpl implements PersonalCenterService {

    @Autowired
    private PersonalCenterDao personalCenterDao;

    @Autowired
    private StringRedisTemplate redisTemplate;


    @Override
    public Result getSession() {
        String username = redisTemplate.opsForValue().get("usernamee");
        QueryWrapper<User> wrapper=new QueryWrapper<>();
        wrapper.eq("username",username);
        User user = personalCenterDao.selectOne(wrapper);
        //System.out.println("这个+"+user);
        return new Result(2000,"查询成功",user);
    }
}
